import 'dart:async';
import 'dart:io';

import 'package:gate_cli/utils/intl_view/utils/intl_http_sever.dart';
import 'package:gate_cli/utils/intl_view/utils/intl_socket_server.dart';
import 'package:gate_cli/utils/intl_view/utils/pull_smartling_flutter.dart';

class IntlViewCommandUtil {
  static FutureOr<String>? run() async {
    pullSmartlingFlutter(true);

    print('Enter "Control + C" to quit.');

    IntlSocketServer.instance.run();

    await IntlHTTPServer.instance.run(
      project: Directory.current.path,
    );

    return '';
  }
}
